//
//  YWRequestHeaderTool.m
//  StockNumber1
//
//  Created by yellow on 2019/9/26.
//  Copyright © 2019 YW. All rights reserved.
//

#import "YWRequestHeaderTool.h"

@implementation YWRequestHeaderTool

+ (void)requestHeaderStatusesWithParameters:(YWRequestHeaderParam *)param success:(void (^)(YWRequestHeaderStatus * _Nonnull))success failure:(void (^)(NSError * _Nonnull))failure{
    
    NSString *url = [NSString stringWithFormat:@"%@/api/UserInfo/LoginToken",domainURL];
    
    
    [YWHttpTool GET:url parameters:param.keyValues success:^(id responseObject) {
        
        //        YWLog(@"%@",responseObject);
        
        YWRequestHeaderStatus *status = [YWRequestHeaderStatus objectWithKeyValues:responseObject] ;
        
        
        // 传递了block
        if (success) {
            success(status);
        }
        
    } failure:^(NSError *error) {
        
        if (failure) {
            failure(error);
        }
        
    }];
}

@end
